import { createRouter, createWebHistory } from "vue-router";
import routes from "./index";

const defaultRoutes = routes.filter((item) => !['ActivityEditor', 'UserLogin'].includes(item.name));
const noLayoutRoutes = routes.filter((item) => ['ActivityEditor', 'UserLogin'].includes(item.name));

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: () => import("@/xldd-admin/layout/default.vue"),
      children: defaultRoutes,
    },
    {
      path: "/",
      component: () => import("@/xldd-admin/layout/no-layout.vue"),
      children: noLayoutRoutes,
    },
  ],
});

export default router;
